package com.wulian.common.util.log;


import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 
* @ClassName: Log 
* @Description: TODO(LOG常量定义，关键词定义) 
* @author 马志豪
* @date 2019年9月10日 下午3:23:51 
*
 */
public class Log {

    public static final String BEGINLINE = "-------------------------请求开始-------------------------";
    public static final String ENDLINE = "-------------------------请求结束-------------------------";
    public static final String KEYWORD_CLIENT = "[客户端信息]:{}";
    public static final String KEYWORD_REQUEST_TIME = "[请求耗时统计]:{}";
    public static final String KEYWORD_SERVICE_TIME = "[业务耗时统计]:{}";
    public static final String KEYWORD_ARGS_IN = "[入参]:{}";
    public static final String KEYWORD_ARGS_OUT = "[出参]:{}";
    public static final String KEYWORD_WARN = "[警告]:{}";
    public static final String KEYWORD_SUSPICIOUS = "[可疑]:{}";
    public static final String KEYWORD_SUSPICIOUS_REFERER = "[来源可疑]:{}";
    public static final String KEYWORD_ERROR_SYSINFO = "[错误时系统信息]:{}";

    /**
     * 自定义关键词
     */
    public static Map<String, String> logs = new ConcurrentHashMap<>();

    /**
     * 获取自定义关键词
     *
     * @param key
     * @return
     */
    public static String get(String key) {
        return logs.get(key);
    }

    /**
     * 添加自定义关键词
     *
     * @param key
     * @param value
     * @return
     */
    public static String add(String key, String value) {
        return logs.put(key, value);
    }

}
